﻿//----------------------------------------------
//            NGUI: Next-Gen UI kit
// Copyright © 2011-2013 Tasharen Entertainment
//----------------------------------------------

using UnityEngine;

/// <summary>
/// Tween to Function.
/// </summary>

[AddComponentMenu("NGUI/Tween/TweenCallFunction")]
public class TweenCallFunction : UITweener
{
	public Vector3 from;
	public Vector3 to;

	Transform mTrans;

	public Transform cachedTransform { get { if (mTrans == null) mTrans = transform; return mTrans; } }
	public Vector3 position { get { return cachedTransform.localPosition; } set { cachedTransform.localPosition = value; } }

	protected override void OnUpdate (float factor, bool isFinished) {  }

	/// <summary>
	/// Start the tweening operation.
	/// </summary>

	static public TweenCallFunction Begin (GameObject go, float duration, Vector3 pos)
	{
		TweenCallFunction comp = UITweener.Begin<TweenCallFunction>(go, duration);		
		return comp;
	}
}